package com.naiterui.ehp.bs.agent.vo;

import com.naiterui.ehp.bs.agent.entity.AgNoticeMessage;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;

import java.util.Date;

/**
 * @author yiren
 * @since 2022/2/22
 */
@Data
@Builder
public class NoticeItemVO {
	@ApiModelProperty(value = "消息标题")
	private String title;
	@ApiModelProperty(value = "消息内容")
	private String content;
	@ApiModelProperty(value = "消息类型（1:系统公告,2:认证消息, 3:新增客户）")
	private Integer type;
	@ApiModelProperty(value = "发布时间")
	private Date releaseTime;

	@ApiModelProperty(value = "发布时间戳")
	private Long releaseTimeNum;
	public static NoticeItemVO of (AgNoticeMessage message) {
		return NoticeItemVO.builder().title(message.getTitle()).content(message.getContent())
				.type(message.getType()).releaseTime(message.getReleaseTime())
				.releaseTimeNum(message.getReleaseTime().getTime())
				.build();
	}
}
